using System;
using System.Data;
using TimeSheetDAL;

namespace TimeSheetBLL
{

	[TableAttribute("activity")]
	[PrimaryKeyAttribute("activity_id", "ID")]
	[ColumnAttribute("activity_name", "ActivityName")]
	[ColumnAttribute("description", "Description")]
	[ColumnAttribute("active", "Active")]
	public class Activity : IDBEntity
	{

		private string activityName;
		private string description;
		private bool active;
		private long iD;

		public Activity()
		{
			this.active = true;
		}

		public DataTable GetActivityHoursByDate( DateTime from, DateTime to )
		{
			DBFacade dbf = new DBFacade();
			return dbf.GetActivityHoursByDate( this.iD, from, to );
		}

		public double GetTotalHoursByDate( DateTime from, DateTime to )
		{
			DBFacade dbf = new DBFacade();
			return dbf.GetTotalActivityHoursByDate( this.iD, from, to );
		}

		public static DataTable GetActivityTotalHoursByDateRange( DateTime start, DateTime end )
		{
			DBFacade dbf = new DBFacade();
			return dbf.GetActivityTotalHoursByDate( start, end );
		}

		#region Generated 
		public long ID
		{

			get
			{
				return this.iD;
			}set
			 {
				 this.iD = value; 
			 }
		}

		public string ActivityName
		{

			get
			{
				return this.activityName;
			}set
			 {
				 this.activityName = value; 
			 }
		}

		public string Description
		{

			get
			{
				return this.description;
			}set
			 {
				 this.description = value; 
			 }
		}

		public bool Active
		{

			get
			{
				return this.active;
			}set
			 {
				 this.active = value; 
			 }
		}
		#endregion

	}//class
}//namespace